package com.lt.flashcard.model.entity;

// Generated Nov 10, 2012 1:29:52 PM by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Learnhistory generated by hbm2java
 */
@Entity
@Table(name = "learnhistory")
public class Learnhistory implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long id;
	private User user;
	private FlashcardSet flashcardset;
	private Date learnOn;
	private String dataid;
	private int type;
	private int totalquestion;
	private int totalmultichoice;
	private int totalmatching;
	private int totaltyping;
	private int resultscore;
	private int resulttime;
	private int totalwords;
	private int resultrightwords;
	private int seriesindex = 1;//The index in a series of continuous testing

	public Learnhistory() {
	}

	public Learnhistory(User user, FlashcardSet flashcardset, Date learnOn,
			String dataid, int type, int totalquestion, int totalmultichoice,
			int totalmatching, int totaltyping, int resultscore, int resulttime) {
		this.user = user;
		this.flashcardset = flashcardset;
		this.learnOn = learnOn;
		this.dataid = dataid;
		this.type = type;
		this.totalquestion = totalquestion;
		this.totalmultichoice = totalmultichoice;
		this.totalmatching = totalmatching;
		this.totaltyping = totaltyping;
		this.resultscore = resultscore;
		this.resulttime = resulttime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "flashcardset_id", nullable = false)
	public FlashcardSet getFlashcardset() {
		return this.flashcardset;
	}

	public void setFlashcardset(FlashcardSet flashcardset) {
		this.flashcardset = flashcardset;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "learnOn", nullable = false, length = 0)
	public Date getLearnOn() {
		return this.learnOn;
	}

	public void setLearnOn(Date learnOn) {
		this.learnOn = learnOn;
	}

	@Column(name = "dataid", nullable = false, length = 50)
	public String getDataid() {
		return this.dataid;
	}

	public void setDataid(String dataid) {
		this.dataid = dataid;
	}

	@Column(name = "type", nullable = false)
	public int getType() {
		return this.type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Column(name = "totalquestion", nullable = false)
	public int getTotalquestion() {
		return this.totalquestion;
	}

	public void setTotalquestion(int totalquestion) {
		this.totalquestion = totalquestion;
	}

	@Column(name = "totalmultichoice", nullable = false)
	public int getTotalmultichoice() {
		return this.totalmultichoice;
	}

	public void setTotalmultichoice(int totalmultichoice) {
		this.totalmultichoice = totalmultichoice;
	}

	@Column(name = "totalmatching", nullable = false)
	public int getTotalmatching() {
		return this.totalmatching;
	}

	public void setTotalmatching(int totalmatching) {
		this.totalmatching = totalmatching;
	}

	@Column(name = "totaltyping", nullable = false)
	public int getTotaltyping() {
		return this.totaltyping;
	}

	public void setTotaltyping(int totaltyping) {
		this.totaltyping = totaltyping;
	}

	@Column(name = "resultscore", nullable = false)
	public int getResultscore() {
		return this.resultscore;
	}

	public void setResultscore(int resultscore) {
		this.resultscore = resultscore;
	}

	@Column(name = "resulttime", nullable = false)
	public int getResulttime() {
		return this.resulttime;
	}

	public void setResulttime(int resulttime) {
		this.resulttime = resulttime;
	}

	@Column(name = "totalwords", nullable = false)
	public int getTotalwords() {
		return this.totalwords;
	}

	public void setTotalwords(int totalwords) {
		this.totalwords = totalwords;
	}

	@Column(name = "resultrightwords", nullable = false)
	public int getResultrightwords() {
		return this.resultrightwords;
	}

	public void setResultrightwords(int resultrightwords) {
		this.resultrightwords = resultrightwords;
	}
	
	@Column(name = "seriesindex", nullable = false)
	public int getSeriesindex() {
		return this.seriesindex;
	}

	public void setSeriesindex(int seriesindex) {
		this.seriesindex = seriesindex;
	}
}
